import request from '../utils/request';

/**
 * 确认下单
 */
export const confirmOrderApi = () => {
  return request(`/mall-api/order/trade`);
}

/**
 * 立即购买
 */
export const buyNowApi = (goodsId, blessing) => {
  return request(`/mall-api/order/buy/${goodsId}`, {
    blessing
  });
}

/**
 * 提交生成服务器订单
 */
export const submitOrderApi = (data) => {
  return request(`/mall-api/order/submitOrder`, data, 'POST');
}

/**
 * 生成微信订单，得到微信支付参数
 */
export const createWeixinOrderApi = (orderNo) => {
  return request(`/mall-api/webChat/createJsapi/${orderNo}`);
}
